import { FormSchema } from '/@/components/Table';

export const formSchema: FormSchema[] = [
  {
    field: 'workItemName',
    label: '流程名称',
    component: 'Input',
    required: true,
    componentProps: {
      placeholder: '请输入申请名称',
    },
  },
  {
    field: 'configTransfer',
    label: '允许转发',
    component: 'Select',
    required: true,
    componentProps: {
      options: [
        { label: '不可转发', value: 0 },
        { label: '可以转发', value: 1 },
        { label: '部门内转发', value: 2 },
      ],
    },
  },
  {
    label: '修改原因',
    field: 'restoreWorkItemReason',
    required: true,
    component: 'InputTextArea',
    colProps: {
      span: 24,
    },
  },
];

export const stateIdOptions = [
  { label: '未处理', value: 0 },
  { label: '已阅读', value: 1 },
  { label: '处理中', value: 2 },
  { label: '已完成', value: 3 },
  { label: '已过期', value: 4 },
  { label: '已撤回', value: 5 },
  { label: '嵌入或启动状态', value: 6 },
  { label: '系统帮忙处理完成的状态', value: 7 },
  { label: '其他状态', value: 9 },
  { label: '嵌入或启动成功流转后的状态', value: 11 },
  { label: '嵌入或启动失败流转后的状态', value: 12 },
  { label: '启动成功接收后的状态', value: 13 },
  { label: '启动失败接收后的状态', value: 14 },
];

export const conditionFormSchema: FormSchema[] = [
  {
    field: 'stateID',
    label: '处理状态',
    component: 'Select',
    required: true,
    componentProps: {
      options: stateIdOptions,
    },
  },
  {
    field: 'recipientID',
    label: '处理人员',
    component: 'HChooseUser',
    required: true,
    componentProps: {
      maxSelect: 1,
    },
  },
  {
    field: 'inceptDate',
    label: '接收时间',
    component: 'DatePicker',
    required: true,
    componentProps: {
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  {
    field: 'readDate',
    label: '阅读时间',
    component: 'DatePicker',
    componentProps: {
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  {
    field: 'finishedDate',
    label: '完成时间',
    component: 'DatePicker',
    componentProps: {
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  {
    field: 'callDate',
    label: '撤回时间',
    component: 'DatePicker',
    componentProps: {
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  {
    field: 'activityChoice',
    label: '批示选项',
    component: 'Select',
    required: true,
    colProps: {
      span: 24,
    },
  },
  {
    label: '批示意见',
    field: 'choiceContent',
    component: 'InputTextArea',
    colProps: {
      span: 24,
    },
  },
];

export const newConditionFormSchema: FormSchema[] = [
  {
    field: 'activityId',
    label: '触发步骤',
    component: 'Select',
    required: true,
  },
  {
    field: 'originalID',
    label: '触发状态',
    component: 'Select',
    required: true,
  },
  {
    field: 'addRecipientIdList',
    label: '参与人员',
    component: 'HChooseUser',
    required: true,
  },
];

export const roleFormSchema: FormSchema[] = [
  {
    field: 'roleName',
    label: '角色名称',
    component: 'Input',
    required: true,
    componentProps: {
      placeholder: '请输入申请名称',
    },
  },
  {
    field: 'roleType',
    label: '角色类型',
    component: 'Input',
    required: true,
  },
  {
    field: 'roleValue',
    label: '用户列表',
    component: 'Input',
    required: true,
  },
];
